package upmc.fr.android.model;

import java.io.Serializable;
import java.util.Date;



public class RSSArticle implements Serializable
{
	private static final long serialVersionUID = 7195401744143940041L;
	private String title;
	private String url;
	private String description;	
	private boolean read = false;
	private boolean hidden = false;
	private Date date;
	
	public RSSArticle()
	{
		read = false;
	}
	
	public boolean isRead() 
	{
		return read;
	}

	public void setRead(boolean read) 
	{
		this.read = read;
	}

	public String getDescription() 
	{		
		return description;
	}

	public String getUrl() 
	{
		return url;
	}

	public String getTitle() 
	{
		return title;
	}

	public void setDescription(String description) 
	{		
		this.description = description;
	}

	public void setTitle(String title) 
	{
		this.title = title;
	}

	public void setUrl(String url)
	{
		this.url = url;
	}

	public void setDate(Date date) 
	{
		this.date = date;
	}

	public Date getDate() 
	{
		return date;
	}	

	public boolean isHidden() 
	{
		return hidden;
	}

	public void setHidden(boolean hidden) 
	{
		this.hidden = hidden;
	}

	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + ((date == null) ? 0 : date.hashCode());
		result = prime * result
				+ ((description == null) ? 0 : description.hashCode());
		result = prime * result + ((title == null) ? 0 : title.hashCode());
		result = prime * result + ((url == null) ? 0 : url.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) 
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof RSSArticle))
			return false;
		RSSArticle other = (RSSArticle) obj;
		if (date == null) {
			if (other.date != null)
				return false;
		} else if (!date.equals(other.date))
			return false;
		if (description == null) {
			if (other.description != null)
				return false;
		} else if (!description.equals(other.description))
			return false;
		if (title == null) {
			if (other.title != null)
				return false;
		} else if (!title.equals(other.title))
			return false;
		if (url == null) {
			if (other.url != null)
				return false;
		} else if (!url.equals(other.url))
			return false;
		return true;
	}	
	
	
}
